﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using PaintDotNet;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using PaintDotNet.PropertySystem;
using System.Configuration;

namespace AMPEffects
{
    public abstract class TiledAmpEffectBase : AmpEffectBase
    {
        private static int BUFF_SIZE = Marshal.SizeOf(typeof(ColorBgra));

        public int ApronSize { get; set; }
        private System.Diagnostics.Stopwatch tmr;

        public TiledAmpEffectBase(string name, Image image, string subMenuName, PaintDotNet.Effects.EffectFlags flags)
            : base(name, image, subMenuName, flags)
        {
            MaximumRegionWidth = 1024;
            MaximumRegionHeight = 1024;
            CustomRegionHandling = true;
        }

        protected override void OnPreRender(RenderArgs dstArgs, RenderArgs srcArgs)
        {
            KeyValueConfigurationElement displayTimer = GetDllConfig().AppSettings.Settings["Timer"];

            if (displayTimer != null && displayTimer.Value == "1")
            {
                this.tmr = new System.Diagnostics.Stopwatch();
                this.tmr.Start();
            }

            base.OnPreRender(dstArgs, srcArgs);
        }
        
        protected override PropertyCollection OnCreatePropertyCollection()
        {
            return null;
        }
    }
}
